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

Failed test_write_filtered_python_package test case in ./python -We -m test -v test_zipfile #104089

Closed
furkanonder opened this issue May 2, 2023 · 1 comment · Fixed by #104137
Labels
tests Tests in the Lib/test dir type-bug An unexpected behavior, bug, or error

Comments

@furkanonder
Copy link
Contributor

furkanonder commented May 2, 2023

Bug report

======================================================================
FAIL: test_write_filtered_python_package (test.test_zipfile.test_core.PyZipFileTests.test_write_filtered_python_package)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/workspace/cpython/Lib/test/test_zipfile/test_core.py", line 1240, in test_write_filtered_python_package
    self.assertTrue('SyntaxError' not in reportStr)
AssertionError: False is not true

----------------------------------------------------------------------
Ran 287 tests in 17.715s

FAILED (failures=1, skipped=4)
test test_zipfile failed
test_zipfile failed (1 failure)

== Tests result: FAILURE ==

1 test failed:
    test_zipfile

Total duration: 17.9 sec
Tests result: FAILURE

Your environment

  • CPython versions tested on: CPython 3.12.0a7+
  • Operating system and architecture: Ubuntu 22.04.2 LTS | Linux-5.15.0-47-generic-x86_64-with-glibc2.35 little-endian

Linked PRs

@furkanonder furkanonder added the type-bug An unexpected behavior, bug, or error label May 2, 2023
@sunmy2019
Copy link
Member

sunmy2019 commented May 2, 2023

Starts from 1ef61cf

Also fails for

./python -We -m test test_fstring

This is due to a syntax warning raised on an invalid escape sequence \{ \}.
It's a syntax error in -We.

Related Issue: #103786

Should be fixed by something like

        self.assertEqual(f'\{{\}}', '\\{\\}')

->

        with warnings.catch_warnings(record=True):
            self.assertEqual(eval(r"f'\{{\}}'"), '\\{\\}')

A helper function should be added here to assert the warning is raised.

@AlexWaygood AlexWaygood added the tests Tests in the Lib/test dir label May 3, 2023
sunmy2019 added a commit to sunmy2019/cpython that referenced this issue May 4, 2023
AlexWaygood added a commit that referenced this issue May 4, 2023
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
tests Tests in the Lib/test dir type-bug An unexpected behavior, bug, or error
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants