Skip to content

Fix some problems in the pytest adapter.#5648

Merged
DonJayamanne merged 13 commits into
microsoft:masterfrom
ericsnowcurrently:pytest-adapter-cleanup
Jun 18, 2019
Merged

Fix some problems in the pytest adapter.#5648
DonJayamanne merged 13 commits into
microsoft:masterfrom
ericsnowcurrently:pytest-adapter-cleanup

Conversation

@ericsnowcurrently
Copy link
Copy Markdown

@ericsnowcurrently ericsnowcurrently commented May 16, 2019

(for #5458)

This is part of the effort to ensure that the pytest adapter can cope with unexpected circumstances (e.g. tests produced by third-party pytest plugins).

Note that this supercedes #5491.

  • Pull request represents a single change (i.e. not fixing disparate/unrelated things in a single PR)
  • Title summarizes what is changing
  • [ ] Has a news entry file (remember to thank yourself!)
  • Appropriate comments and documentation strings in the code
  • [ ] Has sufficient logging.
  • [ ] Has telemetry for enhancements.
  • Unit tests & system/integration tests are added/updated
  • [ ] Test plan is updated as appropriate
  • [ ] package-lock.json has been regenerated by running npm install (if dependencies have changed)
  • [ ] The wiki is updated with any design decisions/details.

@ericsnowcurrently ericsnowcurrently force-pushed the pytest-adapter-cleanup branch from 4bfc859 to 0762284 Compare June 6, 2019 20:22
@ericsnowcurrently ericsnowcurrently added the no-changelog No news entry required label Jun 6, 2019
Copy link
Copy Markdown

@DonJayamanne DonJayamanne left a comment

Choose a reason for hiding this comment

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

Over all good, with few changes:

  • Please remove TODO or add issues for them.
  • When raising exceptions, please add messages so one doens't need to figure out why the exceptions were thrown.
  • Please document the JSON that's returned by this test adapter. This was requested in another PR but still not done. As a user of this code, I don't want to read multiple parts of the code to figure out what's being returned and the structure of the over all JSON (& possible values).

Comment thread pythonFiles/testing_tools/adapter/discovery.py
Comment thread pythonFiles/testing_tools/adapter/pytest/_pytest_item.py Outdated
Comment thread pythonFiles/testing_tools/adapter/pytest/_pytest_item.py Outdated
Comment thread pythonFiles/testing_tools/adapter/pytest/_pytest_item.py Outdated
@DonJayamanne
Copy link
Copy Markdown

Any reason for not addressing the following:

Please document the JSON that's returned by this test adapter. This was requested in another PR but still not done. As a user of this code, I don't want to read multiple parts of the code to figure out what's being returned and the structure of the over all JSON (& possible values).

traceback.print_stack()

msg = 'Unexpected pytest node (see printed output).'
exc = NotImplementedError(msg)
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Do we really need to create a variable for this? Feels rather unnecessary.
Why not just inline this string?

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

No need to change.

@DonJayamanne DonJayamanne merged commit 6af799d into microsoft:master Jun 18, 2019
@ericsnowcurrently ericsnowcurrently deleted the pytest-adapter-cleanup branch June 20, 2019 13:23
@lock lock Bot locked as resolved and limited conversation to collaborators Jul 29, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

no-changelog No news entry required

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants