Thanks to visit codestin.com
Credit goes to Github.com

Skip to content

Conversation

@phdye
Copy link

@phdye phdye commented Jun 7, 2025

No description provided.

@phdye phdye closed this Jun 7, 2025
@phdye phdye reopened this Jun 7, 2025
@voieducode voieducode requested a review from Copilot June 9, 2025 23:29
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Adds a full pytest-based test suite, updates test tooling/config to use pytest, and adds support for Python 3.2.

  • Introduce modularized tests under tests/ and a test helper in tests/util.py
  • Update tox.ini, setup.py, .travis.yml, and pytest.ini to add Python 3.2 and switch to pytest
  • Enhance conftest.py for custom .docopt test collection and include a Test-Plan document

Reviewed Changes

Copilot reviewed 19 out of 19 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
tox.ini Add py32 to envlist, skip_missing_interpreters, switch to pytest
setup.py Add “Programming Language :: Python :: 3.2” classifier
.travis.yml Include Python 3.2 in CI matrix
pytest.ini Configure pytest options (addopts = -ra)
conftest.py Support both old/new pytest from_parent APIs for custom tests
tests/util.py Add run_docopt helper for invoking docopt in tests
tests/test_*.py Add comprehensive feature-focused test modules
doc/python-3.2.5/Test-Plan.md New test-plan document detailing suite organization
README.rst Update testing instructions and supported Python versions

doc = 'Usage: prog ' + 'ARG ' * 20
argv = ' '.join('v{}'.format(i) for i in range(20))
result = run_docopt(doc, argv)
assert all(result['ARG'][i] == 'v{}'.format(i) for i in range(20))
Copy link

Copilot AI Jun 9, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] Use a direct equality assertion (e.g. assert result['ARG'] == [f'v{i}' for i in range(20)]) for clearer failure messages.

Suggested change
assert all(result['ARG'][i] == 'v{}'.format(i) for i in range(20))
assert result['ARG'] == [f'v{i}' for i in range(20)]

Copilot uses AI. Check for mistakes.
Comment on lines +32 to +33
for i in range(depth):
assert result['cmd{}'.format(i)] == (i == depth - 1)
Copy link

Copilot AI Jun 9, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] Consider comparing the entire result dict against an expected dict (e.g. {f'cmd{i}': i == depth-1 for i in range(depth)}) to simplify and clarify the test.

Suggested change
for i in range(depth):
assert result['cmd{}'.format(i)] == (i == depth - 1)
expected = {f'cmd{i}': i == depth - 1 for i in range(depth)}
assert result == expected

Copilot uses AI. Check for mistakes.
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

Successfully merging this pull request may close these issues.

1 participant