Skip to content

Enable the python setup.py test command. - #62

Open
Kentzo wants to merge 3 commits into
Martiusweb:masterfrom
GreatFruitOmsk:test_suite
Open

Enable the python setup.py test command.#62
Kentzo wants to merge 3 commits into
Martiusweb:masterfrom
GreatFruitOmsk:test_suite

Conversation

@Kentzo

@Kentzo Kentzo commented Nov 21, 2017

Copy link
Copy Markdown
Contributor

No description provided.

@Martiusweb

Copy link
Copy Markdown
Owner

Hi,

Thanks for you pull-requests. I'll try to review them tomorrow or Friday.

@Kentzo

Kentzo commented Nov 21, 2017

Copy link
Copy Markdown
Contributor Author

No problem.

@Martiusweb

Copy link
Copy Markdown
Owner

Thanks for all your PRs.

Unfortunately this one will not work as it is, because test/__init__.py imports all modules of the package so they're discovered when running python -m unittest test. Emptying test/__init__.py will fix this, but there are some things to change: since python -m unittest test will not work anymore:

  • README and travis configuration needs to be updated to use python setup.py test,
  • test_case_await should probably not be discovered as being part of the suite, hence renamed or ignored in a way,
  • the configuration of test_suite should rather be set in setup.cfg.

@Kentzo

Kentzo commented Dec 5, 2017

Copy link
Copy Markdown
Contributor Author

@Martiusweb Hmm, it seems to work for me (Python 3.6.3) with only one test failing:

FAIL: test_patch_generator_with_multiple_scopes_on_same_dict (test.test_mock.Test_patch_dict_decorator_coroutine_or_generator_scope) [Outher: GLOBAL, inner: LIMITED]
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/kentzo/Documents/Work/GreatFruit/asynctest/test/test_mock.py", line 782, in test_patch_generator_with_multiple_scopes_on_same_dict
    (self.is_patched(), self.second_is_patched()))
AssertionError: Tuples differ: (True, False) != (True, True)

First differing element 1:
False
True

- (True, False)
+ (True, True)

@Kentzo

Kentzo commented Aug 29, 2018

Copy link
Copy Markdown
Contributor Author

@Martiusweb Updated the PR to allow running tests via -m unittest, setup.py test and pytest (setup.py pytest too if you have pytest-runner installed).

Integrated coveralls, but you have to activate it for the repo. Here is an example for my fork: https://coveralls.io/builds/18737375

@Kentzo
Kentzo force-pushed the test_suite branch 3 times, most recently from 3ff9f21 to f29ae2e Compare August 29, 2018 20:59
Kentzo added 2 commits August 29, 2018 14:02
Tests can be run via:

- python setup.py test
- python -m unittest test
- pytest
- pytest test
@Kentzo
Kentzo force-pushed the test_suite branch 2 times, most recently from 37a00b4 to 968494c Compare August 30, 2018 03:01
@Kentzo

Kentzo commented Aug 31, 2018

Copy link
Copy Markdown
Contributor Author

@Martiusweb For coveralls to work on Appveyor, the COVERALLS_REPO_TOKEN has to be set manually after you active the project there.

@Kentzo

Kentzo commented Sep 12, 2018

Copy link
Copy Markdown
Contributor Author

@Martiusweb Anything missing?

@Martiusweb
Martiusweb force-pushed the master branch 3 times, most recently from c2e9ce1 to 967481c Compare April 3, 2019 15:31
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.

2 participants