pyresttest icon indicating copy to clipboard operation
pyresttest copied to clipboard

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

Open svanoort opened this issue 8 years ago • 4 comments

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.

svanoort avatar Mar 17 '16 18:03 svanoort

Hi There,

It gives me bellow error:

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

Thanks

danghoaidanh avatar Mar 24 '16 02:03 danghoaidanh

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

svanoort avatar Mar 30 '16 13:03 svanoort

Thanks

danghoaidanh avatar Apr 03 '16 08:04 danghoaidanh

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!

resilva87 avatar Jul 11 '17 18:07 resilva87