Skip to content

gh-56276: Add tests to test_compare #3199

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

Merged
merged 25 commits into from
May 20, 2023
Merged

gh-56276: Add tests to test_compare #3199

merged 25 commits into from
May 20, 2023

Conversation

csabella
Copy link
Contributor

@csabella csabella commented Aug 24, 2017

The part of the Maier-Panter bpo patch that hasn't been committed yet (doc changes were).

Contributed by: Andy Maier.
Contributed by: Martin Panter.

@matrixise
Copy link
Member

Hello @csabella

What's the status of this PR?

Have a nice day

@csabella
Copy link
Contributor Author

Hi @matrixise,

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

From test_compare part of PR-15167.
@terryjreedy
Copy link
Member

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

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 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 github-actions bot added the stale Stale PR or inactive for long period of time. label Aug 30, 2022
@arhadthedev arhadthedev changed the title bpo-12067: Add tests to test_compare gh-56276: Add tests to test_compare Apr 18, 2023
@arhadthedev
Copy link
Member

Retriggering the latest test suit so everyone concerned has access to the failed logs.

@terryjreedy terryjreedy added the needs backport to 3.11 only security fixes label May 19, 2023
@github-actions github-actions bot removed the stale Stale PR or inactive for long period of time. label May 20, 2023
@terryjreedy terryjreedy merged commit 68ee8b3 into python:main May 20, 2023
@miss-islington
Copy link
Contributor

Thanks @csabella for the PR, and @terryjreedy for merging it 🌮🎉.. I'm working now to backport this PR to: 3.11.
🐍🍒⛏🤖

@miss-islington
Copy link
Contributor

Thanks @csabella for the PR, and @terryjreedy for merging it 🌮🎉.. I'm working now to backport this PR to: 3.11.
🐍🍒⛏🤖

@bedevere-bot
Copy link

GH-104694 is a backport of this pull request to the 3.11 branch.

@bedevere-bot bedevere-bot removed the needs backport to 3.11 only security fixes label May 20, 2023
@python python deleted a comment from miss-islington May 20, 2023
miss-islington pushed a commit to miss-islington/cpython that referenced this pull request May 20, 2023
(cherry picked from commit 68ee8b3)

Co-authored-by: Cheryl Sabella <[email protected]>
Co-authored-by: Terry Jan Reedy <[email protected]>
Co-authored-by: Oleg Iarygin <[email protected]>
terryjreedy added a commit that referenced this pull request May 20, 2023
gh-56276: Add tests to test_compare (GH-3199)
(cherry picked from commit 68ee8b3)

Co-authored-by: Cheryl Sabella <[email protected]>
Co-authored-by: Terry Jan Reedy <[email protected]>
Co-authored-by: Oleg Iarygin <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants