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

bpo-12067: Add tests to test_compare #3199

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Open

Conversation

csabella
Copy link
Contributor

@csabella csabella commented Aug 24, 2017

Last part of existing patch that hasn't been committed yet.

Patch by Andy Maier and Martin Panter.

https://bugs.python.org/issue12067

@matrixise
Copy link
Member

matrixise commented Jan 30, 2018

Hello @csabella

What's the status of this PR?

Have a nice day

@csabella
Copy link
Contributor Author

csabella commented Jan 30, 2018

Hi @matrixise,

It hasn't been reviewed yet. I don't have any other updates.

From test_compare part of PR-15167.
Lib/test/test_compare.py Outdated Show resolved Hide resolved
Lib/test/test_compare.py Outdated Show resolved Hide resolved
Lib/test/test_compare.py Outdated Show resolved Hide resolved
Lib/test/test_compare.py Outdated Show resolved Hide resolved
@terryjreedy
Copy link
Member

terryjreedy commented Jan 26, 2022

Merge conflicts were from test_compare part of #15167. Waiting for retest results.

On issue, Martin Panter said, after committing doc changes, "Someone needs to decide whether to use Andy’s tests as they are, or perhaps modify or drop some or all of them." Cheryl created this PR from the test part of the last .diff file and review is still needed.

@terryjreedy
Copy link
Member

terryjreedy commented Jan 26, 2022

Tests that I presume once passed now fail due to improved constant constant folding and identity checking of results. The following now prints True & True in batch mode, whereas the tests below presume the opposite. (In interactive mode, where each line is compiled separately, they print false as matching constants requires that they be compiled together.) I think all the is not tests should be deleted. Only leave 'a is a' test and 'a is not b' where b is bound to a different constant.

test_binary_sequences (test.test_compare.ComparisonFullTest) ... FAIL
test_numbers (test.test_compare.ComparisonFullTest) ... FAIL
test_sequences (test.test_compare.ComparisonFullTest) ... FAIL

======================================================================
FAIL: test_binary_sequences (test.test_compare.ComparisonFullTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/runner/work/cpython/cpython/Lib/test/test_compare.py", line 642, in test_binary_sequences
    self.assertIsNot(bs2, bs3, "Testcase error: bs2 is bs3")
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError: unexpectedly identical: b'b2' : Testcase error: bs2 is bs3

======================================================================
FAIL: test_numbers (test.test_compare.ComparisonFullTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/runner/work/cpython/cpython/Lib/test/test_compare.py", line 516, in test_numbers
    self.assertIsNot(c2, c3, "Testcase error: c2 is c3")
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError: unexpectedly identical: (2+2j) : Testcase error: c2 is c3

======================================================================
FAIL: test_sequences (test.test_compare.ComparisonFullTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/runner/work/cpython/cpython/Lib/test/test_compare.py", line 604, in test_sequences
    self.assertIsNot(t2, t3, "Testcase error: t2 is t3")
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError: unexpectedly identical: (2, 3) : Testcase error: t2 is t3

@github-actions
Copy link

github-actions bot commented Feb 26, 2022

This PR is stale because it has been open for 30 days with no activity.

@github-actions github-actions bot added the stale Stale PR or inactive for long period of time. label Feb 26, 2022
@github-actions github-actions bot removed the stale Stale PR or inactive for long period of time. label Jul 29, 2022
@github-actions
Copy link

github-actions bot commented Aug 30, 2022

This PR is stale because it has been open for 30 days with no activity.

@github-actions github-actions bot added the stale Stale PR or inactive for long period of time. label Aug 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
awaiting review stale Stale PR or inactive for long period of time.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants