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

Add command-line option to reuse contexts between tests & improve imports handling. #178

Open
5 tasks
svanoort opened this issue Mar 17, 2016 · 4 comments
Open
5 tasks

Comments

@svanoort
Copy link
Owner

This allows people to use imports as adhoc setup/teardown options (albeit without the ability to ignore setup/teardown errors).

  • Create command-line option "--shared-context=True" that is parsed and passed into run_testsets.
  • If shared-context is true, testsets and benchmarks don't get fresh contexts, they reuse the same one (option to receive one already exists).
  • Add test case for this (functional test)
  • Add changelog note about this: in the next release, it will be usable but off by default (to avoid unexpected behavior with existing tests), in the one after, it will be on by default (gives more predictable user behavior).
  • To think about: change import behavior, or add an 'include' element, such that the imported testset executes after current test/benchmark elements, but before the final ones in current testset.
@danghoaidanh
Copy link

Hi There,

It gives me bellow error:

resttest.py: error: no such option: --shared-context

Thanks

@svanoort
Copy link
Owner Author

@danghoaidanh It is not implemented yet, this is on the future roadmap for enhancements.

@danghoaidanh
Copy link

Thanks

@resilva87
Copy link

Hi @svanoort
I implemented this feature in my forked repo: https://github.com/resilva87/pyresttest/tree/feature/shared-context

Quick question: when I try to run the tests (with run_tests.sh ) I keep getting the following error: "django.core.exceptions.AppRegistryNotReady: Apps aren't loaded yet."

I'm building and running pyresttest with py3, do you have any ideas?

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants