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

Better testing #3

Open
2 tasks done
Daenyth opened this issue Aug 31, 2016 · 10 comments
Open
2 tasks done

Better testing #3

Daenyth opened this issue Aug 31, 2016 · 10 comments

Comments

@Daenyth
Copy link
Contributor

Daenyth commented Aug 31, 2016

  • Add tox.ini
  • Change handmade test runner to pytest
    • Add a conftest.py with a pytest plugin adding a CLI arg flag.
    • The conn fixture can examine the contents of that arg flag to decide whether to run tests on mockthink connection, rethink connection, or both
@Daenyth
Copy link
Contributor Author

Daenyth commented Aug 31, 2016

WIP tox.ini

[tox]
envlist = py27 py35
[testenv]
deps =
    pytest
    py27: mock
commands = py.test {posargs}

Daenyth pushed a commit to Daenyth/mockthink that referenced this issue Aug 31, 2016
@scivey
Copy link
Owner

scivey commented Oct 24, 2016

what would a basic pytest setup to replace this look like? I'm assuming we'd need to write some kind of adapter.

@Daenyth
Copy link
Contributor Author

Daenyth commented Oct 24, 2016

It's been a while but IIRC you have a custom test runner so you can on cli instruct it to use either real rethink or mockthink as the connection object?

It will be a small pytest plugin (defined in a conftest.py) as I describe above.

The tests would be changed to accept a connection fixture as a parameter, the fixture being also defined in conftest.py and using the cli argument that the plugin provides, so that you can do py.test --rethink-conn foobar tests/ or so

@Daenyth
Copy link
Contributor Author

Daenyth commented Oct 24, 2016

@Daenyth
Copy link
Contributor Author

Daenyth commented Oct 24, 2016

@scivey
Copy link
Owner

scivey commented Oct 26, 2016

@Daenyth sounds like you just volunteered!

@Daenyth
Copy link
Contributor Author

Daenyth commented Oct 26, 2016

When I have time.

Daenyth pushed a commit to Daenyth/mockthink that referenced this issue Oct 26, 2016
@scivey
Copy link
Owner

scivey commented Dec 7, 2016

@Daenyth did your merged-in PR cover this?

@Daenyth
Copy link
Contributor Author

Daenyth commented Dec 7, 2016

Yes, we can close this

@naman-d98
Copy link

Is this mockthink lib compatible with python 2.7??

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

No branches or pull requests

3 participants