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

4.1.2: test_plugin.py problems #301

Closed
0-wiz-0 opened this issue Nov 13, 2023 · 1 comment
Closed

4.1.2: test_plugin.py problems #301

0-wiz-0 opened this issue Nov 13, 2023 · 1 comment

Comments

@0-wiz-0
Copy link

0-wiz-0 commented Nov 13, 2023

When running the self tests of the pypi 4.1.2 source wheel using pytest on Python 3.11.6/NetBSD, I see:

/usr/pkg/lib/python3.11/site-packages/_pytest/python.py:617: in _importtestmodule
    mod = import_path(self.path, mode=importmode, root=self.config.rootpath)
/usr/pkg/lib/python3.11/site-packages/_pytest/pathlib.py:567: in import_path
    importlib.import_module(module_name)
/usr/pkg/lib/python3.11/importlib/__init__.py:126: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
<frozen importlib._bootstrap>:1204: in _gcd_import
    ???
<frozen importlib._bootstrap>:1176: in _find_and_load
    ???
<frozen importlib._bootstrap>:1147: in _find_and_load_unlocked
    ???
<frozen importlib._bootstrap>:690: in _load_unlocked
    ???
/usr/pkg/lib/python3.11/site-packages/_pytest/assertion/rewrite.py:177: in exec_module
    source_stat, co = _rewrite_test(fn, self.config)
/usr/pkg/lib/python3.11/site-packages/_pytest/assertion/rewrite.py:359: in _rewrite_test
    tree = ast.parse(source, filename=strfn)
/usr/pkg/lib/python3.11/ast.py:50: in parse
    return compile(source, filename, mode, flags,
E     File "/scratch/devel/py-bitstring/work/bitstring-4.1.2/bitstring/plugin_test.py", line 8
E       reverse_int = Dtype(name='uintr', getter=getuintr, setter=setuintr)
E       ^^^^^^^^^^^
E   IndentationError: expected an indented block after function definition on line 6

If I add a "pass" in line 6, I get this instead:

ImportError while importing test module '/scratch/devel/py-bitstring/work/bitstring-4.1.2/bitstring/plugin_test.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
/usr/pkg/lib/python3.11/importlib/__init__.py:126: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
bitstring/plugin_test.py:2: in <module>
    from bitstring import Dtype
E   ImportError: cannot import name 'Dtype' from 'bitstring' (/scratch/devel/py-bitstring/work/bitstring-4.1.2/bitstring/__init__.py)

When I remove this test file, the other tests succeed without further problems.

@0-wiz-0 0-wiz-0 changed the title test_plugin.py problems. 4.1.2: test_plugin.py problems Nov 13, 2023
@scott-griffiths
Copy link
Owner

Hi, yes that file got accidentally included in the source wheel - see bug #293.

Thanks for the report - I think this is covered by the earlier bug so I'll close as a duplicate, but I should do a release just to fix this issue as nothing else has turned up recently.

@scott-griffiths scott-griffiths closed this as not planned Won't fix, can't repro, duplicate, stale Nov 15, 2023
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

No branches or pull requests

2 participants