Note: This is a public test instance of Red Hat Bugzilla. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback at bugzilla.redhat.com.
Bug 1787902 - pytest fails to build with Python 3.9
Summary: pytest fails to build with Python 3.9
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: pytest
Version: rawhide
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Miro Hrončok
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: PYTHON39
TreeView+ depends on / blocked
 
Reported: 2020-01-05 10:37 UTC by Miro Hrončok
Modified: 2020-02-10 14:21 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2020-02-10 14:21:07 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github pytest-dev pytest issues 6404 0 None closed Python 3.9: DeprecationWarning: The parser module 2020-02-10 14:12:09 UTC

Description Miro Hrončok 2020-01-05 10:37:58 UTC
pytest fails to build with Python 3.9.0a2.

_______________________________ test_isparseable _______________________________

    def test_isparseable():
>       assert Source("hello").isparseable()

/builddir/build/BUILD/pytest-4.6.8/testing/code/test_source.py:130: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <_pytest._code.source.Source object at 0x7f25d53afaf0>, deindent = True

    def isparseable(self, deindent=True):
        """ return True if source is parseable, heuristically
            deindenting it by default.
        """
>       from parser import suite as syntax_checker
E       DeprecationWarning: The parser module is deprecated and will be removed in future versions of Python

/builddir/build/BUILDROOT/pytest-4.6.8-1.fc32.x86_64/usr/lib/python3.9/site-packages/_pytest/_code/source.py:126: DeprecationWarning
__________________________ TestAccesses.test_getrange __________________________

self = <test_source.TestAccesses object at 0x7f25d5c02670>

    def test_getrange(self):
        x = self.source[0:2]
>       assert x.isparseable()

/builddir/build/BUILD/pytest-4.6.8/testing/code/test_source.py:150: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <_pytest._code.source.Source object at 0x7f25d59a7190>, deindent = True

    def isparseable(self, deindent=True):
        """ return True if source is parseable, heuristically
            deindenting it by default.
        """
>       from parser import suite as syntax_checker
E       DeprecationWarning: The parser module is deprecated and will be removed in future versions of Python

/builddir/build/BUILDROOT/pytest-4.6.8-1.fc32.x86_64/usr/lib/python3.9/site-packages/_pytest/_code/source.py:126: DeprecationWarning

For the build logs, see:
https://copr-be.cloud.fedoraproject.org/results/@python/python3.9/fedora-rawhide-x86_64/01138614-pytest/

For all our attempts to build pytest with Python 3.9, see:
https://copr.fedorainfracloud.org/coprs/g/python/python3.9/package/pytest/

Testing and mass rebuild of packages is happening in copr. You can follow these instructions to test locally in mock if your package builds with Python 3.9:
https://copr.fedorainfracloud.org/coprs/g/python/python3.9/

Let us know here if you have any questions.

Python 3.9 will be included in Fedora 33, but the initial bootstrapping has already started.
A build failure this early in the bootstrap sequence blocks us very much.

Comment 1 Miro Hrončok 2020-01-05 11:50:01 UTC
pytest 5 has the same problem.

this patch workarounds it before the upstream fix:

--- a/tox.ini
+++ b/tox.ini
@@ -168,6 +168,8 @@ filterwarnings =
     default:invalid escape sequence:DeprecationWarning
     # ignore use of unregistered marks, because we use many to test the implementation
     ignore::_pytest.warning_types.PytestUnknownMarkWarning
+    # https://github.com/pytest-dev/pytest/issues/6404
+    ignore:.*The parser module is deprecated.*:DeprecationWarning
 pytester_example_dir = testing/example_scripts
 markers =
     # dummy markers for testing

Comment 2 Miro Hrončok 2020-02-10 14:21:07 UTC
I've backported the upstream fix from https://github.com/pytest-dev/pytest/commit/f606fef19d035719be6ed862f7f426a0e7c582e1


Note You need to log in before you can comment on or make changes to this bug.