Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enforces having unique test ids in a single namespace #11687

Merged
merged 4 commits into from
Dec 15, 2021
Merged

Enforces having unique test ids in a single namespace #11687

merged 4 commits into from
Dec 15, 2021

Conversation

sobolevn
Copy link
Member

@sobolevn sobolevn commented Dec 8, 2021

I found lots of duplicate test names. It might hide important errors, be hard to reproduce or rerun.

So, let's enforce having unique tests ids.
Note: that some tests have a quite complex name like testFollowImportsNormalPackage2-only_when_cache, where only_when_cache is not really its name, but a running condition.
So, I had to ignore this part and only use name part.

Refs #11662

@sobolevn
Copy link
Member Author

sobolevn commented Dec 8, 2021

Awesome, we even got a newly discovered test failure!

___________________________ testExportModule_import2 ___________________________
[gw1] linux -- Python 3.10.0 /home/runner/work/mypy/mypy/.tox/py/bin/python
data: /home/runner/work/mypy/mypy/test-data/unit/stubgen.test:486:
/home/runner/work/mypy/mypy/mypy/test/teststubgen.py:562: in run_case
    self.run_case_inner(testcase)
/home/runner/work/mypy/mypy/mypy/test/teststubgen.py:595: in run_case_inner
    assert_string_arrays_equal(testcase.output, a,
E   AssertionError: Invalid output (/home/runner/work/mypy/mypy/test-data/unit/stubgen.test, line 486)
----------------------------- Captured stderr call -----------------------------
Expected:
  import re as re                               (diff)
                                                (diff)
  x: int                                        (diff)
Actual:
  x: int                                        (diff)
  y: int                                        (diff)

Alignment of first line difference:
  E: import re as re
  A: x: int
     ^
=========================== short test summary info ============================
FAILED mypy/test/teststubgen.py::StubgenPythonSuite::stubgen.test::testExportModule_import2
====== 1 failed, 9654 passed, 370 skipped, 7 xfailed in 687.98s (0:11:27) ======
ERROR: InvocationError for command /home/runner/work/mypy/mypy/.tox/py/bin/python -m pytest -n 2 (exited with code 1)

@sobolevn
Copy link
Member Author

@hauntsaninja thanks for solving the conflicts! 👍

@JukkaL JukkaL merged commit b4df2b3 into python:master Dec 15, 2021
tushar-deepsource pushed a commit to DeepSourceCorp/mypy that referenced this pull request Jan 20, 2022
I found lots of duplicate test names. It might hide important errors, be hard to reproduce 
or rerun.

Refs python#11662

Co-authored-by: Shantanu <12621235+hauntsaninja@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants