astropy / astropy/pytest-filter-subpackage

3 tests fail: AttributeError: type object 'reprec' has no attribute 'assertoutcome'

Open
#31 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
5
Forks
7
PR merge metrics
No merged PRs in 30d

Description

```
============================================================================== FAILURES ===============================================================================
____________________________________________________________________________ test_with_rst ____________________________________________________________________________

testdir = , testpackage = None

def test_with_rst(testdir, testpackage):
# Make sure all rst tests are also picked up when using pytest-doctestplus
testdir.makeini("""
[pytest]
doctest_plus = enabled
""")
reprec = testdir.inline_run('--doctest-rst')
> reprec.assertoutcome(passed=7, failed=3)
^^^^^^^^^^^^^^^^^^^^
E AttributeError: type object 'reprec' has no attribute 'assertoutcome'

/usr/ports/devel/py-pytest-filter-subpackage/work-py311/pytest-filter-subpackage-0.2.0/tests/test_filter_subpackage.py:17: AttributeError
------------------------------------------------------------------------ Captured stderr call -------------------------------------------------------------------------
ERROR: usage: __main__.py [options] [file_or_dir] [file_or_dir] [...]
__main__.py: error: unrecognized arguments: --doctest-rst
inifile: /tmp/pytest-of-yuri/pytest-54/test_with_rst0/tox.ini
rootdir: /tmp/pytest-of-yuri/pytest-54/test_with_rst0

________________________________________________________________ test_flag_single_subpackage_with_rst _________________________________________________________________

testdir = , testpackage = None

def test_flag_single_subpackage_with_rst(testdir, testpackage):
# Test -P with a single sub-package including rst files
testdir.makeini("""
[pytest]
doctest_plus = enabled
""")
reprec = testdir.inline_run('-P a', '--doctest-rst')
> reprec.assertoutcome(passed=3, failed=0)
^^^^^^^^^^^^^^^^^^^^
E AttributeError: type object 'reprec' has no attribute 'assertoutcome'

/usr/ports/devel/py-pytest-filter-subpackage/work-py311/pytest-filter-subpackage-0.2.0/tests/test_filter_subpackage.py:33: AttributeError
------------------------------------------------------------------------ Captured stderr call -------------------------------------------------------------------------
ERROR: usage: __main__.py [options] [file_or_dir] [file_or_dir] [...]
__main__.py: error: unrecognized arguments: --doctest-rst
inifile: /tmp/pytest-of-yuri/pytest-54/test_flag_single_subpackage_with_rst0/tox.ini
rootdir: /tmp/pytest-of-yuri/pytest-54/test_flag_single_subpackage_with_rst0

_______________________________________________________________ test_flag_multiple_subpackage_with_rst ________________________________________________________________

testdir = , testpackage = None

def test_flag_multiple_subpackage_with_rst(testdir, testpackage):
# Test -P with several sub-packages including rst files
testdir.makeini("""
[pytest]
doctest_plus = enabled
""")
reprec = testdir.inline_run('-P a,b', '--doctest-rst')
> reprec.assertoutcome(passed=4, failed=1)
^^^^^^^^^^^^^^^^^^^^
E AttributeError: type object 'reprec' has no attribute 'assertoutcome'

/usr/ports/devel/py-pytest-filter-subpackage/work-py311/pytest-filter-subpackage-0.2.0/tests/test_filter_subpackage.py:49: AttributeError
------------------------------------------------------------------------ Captured stderr call -------------------------------------------------------------------------
ERROR: usage: __main__.py [options] [file_or_dir] [file_or_dir] [...]
__main__.py: error: unrecognized arguments: --doctest-rst
inifile: /tmp/pytest-of-yuri/pytest-54/test_flag_multiple_subpackage_with_rst0/tox.ini
rootdir: /tmp/pytest-of-yuri/pytest-54/test_flag_multiple_subpackage_with_rst0

===================================================================== 3 failed, 5 passed in 3.40s =====================================================================
*** Error code 1

```

Version: 0.2.0
Python-3.11
FreeBSD 14.3

Contributor guide

No contributing guide indexed for this repository

Research direction

Reproduce the failures in tests/test_filter_subpackage.py under Python 3.11, focusing on the testdir.inline_run calls using --doctest-rst. Check why the returned object lacks assertoutcome and why the option is rejected; done means the three affected tests run with the expected pass and failure counts.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
testing, tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.