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

Reworked test and deploy documentation #1497

Merged
merged 5 commits into from
Jun 27, 2019
Merged

Conversation

matnad
Copy link
Contributor

@matnad matnad commented Jun 25, 2019

What I did

Work on issue #1481

  • Split documentation for testing and deploying a contract
  • Completely revamped documentation for testing to use pytest and eth_tester; complete with examples.
  • Updated documentation for deploying contracts
  • Added two new examples of very simple storage contracts that are used in the testing documentation
  • Added two new test files for said storage contracts
  • Updated the assert_tx_failed fixture in conftest with another optional argument to check for text in exceptions (so we can check for a specific ValidationError for example)

UPDATE:

  • Split conftest.py into:
    • base_conftest.py: includes the base code and fixtures to start testing vyper contracts
    • conftest.py: includes the rest of the functions and fixtures to test our code. Uses base_conftest as a plugin.
  • Adapted Docs to reflect this and included the base_conftest as literalinclude so the docs stays up to date
  • No more non-included code in the doc

How I did it

Modifying the .rst doc files and creating new example contracts with tests

How to verify it

Proof read the documentation and check the contracts (they are simple dummy contracts to showcase testing)

Description for the changelog

Updated documentation for testing and deploying contracts.

Cute Animal Picture

Put a link to a cute animal picture inside the parenthesis-->

matnad added 4 commits June 25, 2019 16:57
- Split documentation for testing and deploying a contract
- Completely revamped documentation for testing to use pytest and eth_tester. Complete with examples.
- Updated documentation for deploying contracts
- Added two new examples of very simple storage contracts that are used in the testing documentation
- Added two new test files for said storage contracts
- Updated the assert_tx_failed fixture in conftest with another optional argument to check for text in exceptions (so we can check for a specific ValidationError for example)
- Split documentation for testing and deploying a contract
- Completely revamped documentation for testing to use pytest and eth_tester. Complete with examples.
- Updated documentation for deploying contracts
- Added two new examples of very simple storage contracts that are used in the testing documentation
- Added two new test files for said storage contracts
- Updated the assert_tx_failed fixture in conftest with another optional argument to check for text in exceptions (so we can check for a specific ValidationError for example)
- Split documentation for testing and deploying a contract
- Completely revamped documentation for testing to use pytest and eth_tester. Complete with examples.
- Updated documentation for deploying contracts
- Added two new examples of very simple storage contracts that are used in the testing documentation
- Added two new test files for said storage contracts
- Updated the assert_tx_failed fixture in conftest with another optional argument to check for text in exceptions (so we can check for a specific ValidationError for example)
- Split documentation for testing and deploying a contract
- Completely revamped documentation for testing to use pytest and eth_tester. Complete with examples.
- Updated documentation for deploying contracts
- Added two new examples of very simple storage contracts that are used in the testing documentation
- Added two new test files for said storage contracts
- Updated the assert_tx_failed fixture in conftest with another optional argument to check for text in exceptions (so we can check for a specific ValidationError for example)

.. code-block:: python

import pytest
Copy link
Contributor

Choose a reason for hiding this comment

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

Perhaps we should consider splitting our existing conftest.py into base_conftest.py and conftest.py which we can include here and it will stay up to date. In our existing conftest.py we just import the base functionality ;)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good idea. I'll make a proposition for this tomorrow and add it to the PR

@jacqueswww
Copy link
Contributor

Very cool!

@fubuloubu
Copy link
Member

fubuloubu commented Jun 25, 2019

Now that we include concrete examples, I definitely think doctest should be used. This PR need not depend on that though, but that should be a next step.


Edit: do Jacques's request instead. But still, should add doctest for features described in docs.

Copy link
Member

@fubuloubu fubuloubu left a comment

Choose a reason for hiding this comment

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

LGTM pending @jacqueswww's comment

@matnad
Copy link
Contributor Author

matnad commented Jun 25, 2019

Now that we include concrete examples, I definitely think doctest should be used. This PR need not depend on that though, but that should be a next step.

Is someone already working on doctests?

@fubuloubu
Copy link
Member

No, but it's here: #1233

This issue doesn't depend on doctests, but we really should add them to prevent out of date syntax being used in the docs.

test.base_conftest is not a plugin.
base_conftest.py includes the base to start testing vyper contracts while conftest.py includes all the other fixtures and functions needed to test our code.
@matnad
Copy link
Contributor Author

matnad commented Jun 26, 2019

Updated PR with request

@jacqueswww jacqueswww merged commit 5510420 into vyperlang:master Jun 27, 2019
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.

3 participants