Browse Source

intermediate changes
ref:d4b5687d4c7a66b907f70930ef85d76f209837f1

arcadia-devtools 2 years ago
parent
commit
7f5e1f5ef4

+ 3 - 3
contrib/python/pytest/py3/.dist-info/METADATA

@@ -1,6 +1,6 @@
 Metadata-Version: 2.1
 Name: pytest
-Version: 7.1.1
+Version: 7.1.2
 Summary: pytest: simple powerful testing with Python
 Home-page: https://docs.pytest.org/en/latest/
 Author: Holger Krekel, Bruno Oliveira, Ronny Pfannschmidt, Floris Bruynooghe, Brianna Laugher, Florian Bruhin and others
@@ -73,8 +73,8 @@ Requires-Dist: xmlschema ; extra == 'testing'
     :target: https://codecov.io/gh/pytest-dev/pytest
     :alt: Code coverage Status
 
-.. image:: https://github.com/pytest-dev/pytest/workflows/main/badge.svg
-    :target: https://github.com/pytest-dev/pytest/actions?query=workflow%3Amain
+.. image:: https://github.com/pytest-dev/pytest/workflows/test/badge.svg
+    :target: https://github.com/pytest-dev/pytest/actions?query=workflow%3Atest
 
 .. image:: https://results.pre-commit.ci/badge/github/pytest-dev/pytest/main.svg
    :target: https://results.pre-commit.ci/latest/github/pytest-dev/pytest/main

+ 2 - 0
contrib/python/pytest/py3/AUTHORS

@@ -185,6 +185,7 @@ Katerina Koukiou
 Keri Volans
 Kevin Cox
 Kevin J. Foley
+Kian Eliasi
 Kian-Meng Ang
 Kodi B. Arfer
 Kojo Idrissa
@@ -255,6 +256,7 @@ Ondřej Súkup
 Oscar Benjamin
 Parth Patel
 Patrick Hayes
+Paul Müller
 Pauli Virtanen
 Pavel Karateev
 Paweł Adamczak

+ 2 - 2
contrib/python/pytest/py3/README.rst

@@ -20,8 +20,8 @@
     :target: https://codecov.io/gh/pytest-dev/pytest
     :alt: Code coverage Status
 
-.. image:: https://github.com/pytest-dev/pytest/workflows/main/badge.svg
-    :target: https://github.com/pytest-dev/pytest/actions?query=workflow%3Amain
+.. image:: https://github.com/pytest-dev/pytest/workflows/test/badge.svg
+    :target: https://github.com/pytest-dev/pytest/actions?query=workflow%3Atest
 
 .. image:: https://results.pre-commit.ci/badge/github/pytest-dev/pytest/main.svg
    :target: https://results.pre-commit.ci/latest/github/pytest-dev/pytest/main

+ 2 - 2
contrib/python/pytest/py3/_pytest/_version.py

@@ -1,5 +1,5 @@
 # coding: utf-8
 # file generated by setuptools_scm
 # don't change, don't track in version control
-version = '7.1.1'
-version_tuple = (7, 1, 1)
+version = '7.1.2'
+version_tuple = (7, 1, 2)

+ 4 - 2
contrib/python/pytest/py3/_pytest/assertion/util.py

@@ -437,8 +437,10 @@ def _compare_eq_cls(left: Any, right: Any, verbose: int) -> List[str]:
     if not has_default_eq(left):
         return []
     if isdatacls(left):
-        all_fields = left.__dataclass_fields__
-        fields_to_check = [field for field, info in all_fields.items() if info.compare]
+        import dataclasses
+
+        all_fields = dataclasses.fields(left)
+        fields_to_check = [info.name for info in all_fields if info.compare]
     elif isattrs(left):
         all_fields = left.__attrs_attrs__
         fields_to_check = [field.name for field in all_fields if getattr(field, "eq")]

+ 1 - 1
contrib/python/pytest/py3/_pytest/nodes.py

@@ -111,7 +111,7 @@ def _imply_path(
             NODE_CTOR_FSPATH_ARG.format(
                 node_type_name=node_type.__name__,
             ),
-            stacklevel=3,
+            stacklevel=6,
         )
     if path is not None:
         if fspath is not None:

+ 2 - 3
contrib/python/pytest/py3/_pytest/python_api.py

@@ -319,7 +319,6 @@ class ApproxSequenceLike(ApproxBase):
 
     def _repr_compare(self, other_side: Sequence[float]) -> List[str]:
         import math
-        import numpy as np
 
         if len(self.expected) != len(other_side):
             return [
@@ -340,7 +339,7 @@ class ApproxSequenceLike(ApproxBase):
                 abs_diff = abs(approx_value.expected - other_value)
                 max_abs_diff = max(max_abs_diff, abs_diff)
                 if other_value == 0.0:
-                    max_rel_diff = np.inf
+                    max_rel_diff = math.inf
                 else:
                     max_rel_diff = max(max_rel_diff, abs_diff / abs(other_value))
                 different_ids.append(i)
@@ -573,7 +572,7 @@ def approx(expected, rel=None, abs=None, nan_ok: bool = False) -> ApproxBase:
         >>> {'a': 0.1 + 0.2, 'b': 0.2 + 0.4} == approx({'a': 0.3, 'b': 0.6})
         True
 
-    The comparision will be true if both mappings have the same keys and their
+    The comparison will be true if both mappings have the same keys and their
     respective values match the expected tolerances.
 
     **Tolerances**

+ 3 - 2
contrib/python/pytest/py3/_pytest/tmpdir.py

@@ -158,9 +158,10 @@ class TempPathFactory:
 def get_user() -> Optional[str]:
     """Return the current user name, or None if getuser() does not work
     in the current environment (see #1010)."""
-    import getpass
-
     try:
+        # In some exotic environments, getpass may not be importable.
+        import getpass
+
         return getpass.getuser()
     except (ImportError, KeyError):
         return None