Skip to content

Commit

Permalink
Merge pull request #1066 from skellet0r/feat/upgrade-hypothesis
Browse files Browse the repository at this point in the history
Upgrade hypothesis to 6.10.0
  • Loading branch information
iamdefinitelyahuman authored Apr 20, 2021
2 parents b48dc2f + 1e1c956 commit f7a657b
Show file tree
Hide file tree
Showing 9 changed files with 16 additions and 9 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased](https://github.com/eth-brownie/brownie)

- Upgraded web3 dependency to version 5.18.0 ([#1064](https://github.com/eth-brownie/brownie/pull/1064))
- Upgraded pytest dependency to version 6.2.3 ([#1065](https://github.com/eth-brownie/brownie/pull/1065))
- Upgraded hypothesis dependency to version 6.10.0 ([#1066](https://github.com/eth-brownie/brownie/pull/1066))

## [1.14.5](https://github.com/eth-brownie/brownie/tree/v1.14.5) - 2021-04-16
### Added
- Added documentation detailing how private Github repositories can be used as a package installation source.
Expand Down
2 changes: 1 addition & 1 deletion brownie/test/strategies.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def wrapper(*args: Tuple, exclude: Any = None, **kwargs: int) -> SearchStrategy:
strat = strat.filter(lambda k: k not in exclude)
# make the filter repr more readable
repr_ = strat.__repr__().rsplit(").filter", maxsplit=1)[0]
strat._cached_repr = f"{repr_}, exclude={exclude})"
strat._LazyStrategy__representation = f"{repr_}, exclude={exclude})"
return strat

return wrapper
Expand Down
2 changes: 1 addition & 1 deletion requirements-windows.txt
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ hexbytes==0.2.1
# eth-event
# eth-rlp
# web3
hypothesis==5.41.3
hypothesis==6.10.0
# via -r requirements.txt
idna==2.10
# via
Expand Down
2 changes: 1 addition & 1 deletion requirements.in
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ eth-event>=1.2.1,<2
eth-hash[pycryptodome]<1
eth-utils<2
hexbytes<1
hypothesis<6
hypothesis<7
prompt-toolkit<4
psutil>=5.7.3,<6
py-solc-ast>=1.2.8,<2
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ hexbytes==0.2.1
# eth-event
# eth-rlp
# web3
hypothesis==5.41.3
hypothesis==6.10.0
# via -r requirements.in
idna==2.10
# via requests
Expand Down
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ force_grid_wrap = 0
include_trailing_comma = True
known_standard_library = tkinter
known_first_party = brownie
known_third_party = _pytest,black,dotenv,ens,eth_abi,eth_account,eth_event,eth_hash,eth_keys,eth_utils,ethpm,hexbytes,hypothesis,mythx_models,prompt_toolkit,psutil,py,pygments,pygments_lexer_solidity,pytest,pythx,requests,rlp,semantic_version,setuptools,solcast,solcx,tqdm,vvm,vyper,web3,xdist,yaml
known_third_party = _pytest,black,dotenv,ens,eth_abi,eth_account,eth_event,eth_hash,eth_keys,eth_utils,ethpm,hexbytes,hypothesis,mythx_models,prompt_toolkit,psutil,pygments,pygments_lexer_solidity,pytest,pythx,requests,rlp,semantic_version,setuptools,solcast,solcx,tqdm,vvm,vyper,web3,xdist,yaml
line_length = 100
multi_line_output = 3
use_parentheses = True
Expand Down
4 changes: 2 additions & 2 deletions tests/network/account/test_get_deployment_address.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
from hypothesis import assume, given, settings
from hypothesis import HealthCheck, assume, given, settings
from hypothesis import strategies as st

from brownie import compile_source


@given(st_privkey=st.binary(min_size=32, max_size=32))
@settings(max_examples=25)
@settings(max_examples=25, suppress_health_check=[HealthCheck.function_scoped_fixture])
def test_get_deployment_address(accounts, st_privkey):
assume(int(st_privkey.hex(), 16))

Expand Down
4 changes: 3 additions & 1 deletion tests/test/strategies/test_address.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/python3

from hypothesis import given
from hypothesis import HealthCheck, given, settings
from hypothesis.strategies._internal.deferred import DeferredStrategy

from brownie.network.account import Account
Expand All @@ -12,12 +12,14 @@ def test_strategy():


@given(value=strategy("address"))
@settings(suppress_health_check=[HealthCheck.function_scoped_fixture])
def test_given(accounts, value):
assert value in accounts
assert isinstance(value, Account)


@given(value=strategy("address", length=3))
@settings(suppress_health_check=[HealthCheck.function_scoped_fixture])
def test_length(accounts, value):
assert list(accounts).index(value) < 3

Expand Down
3 changes: 2 additions & 1 deletion tests/test/strategies/test_contract_strategy.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/python3

import pytest
from hypothesis import given
from hypothesis import HealthCheck, given, settings
from hypothesis.strategies._internal.deferred import DeferredStrategy

from brownie.network.contract import ProjectContract
Expand All @@ -22,5 +22,6 @@ def test_does_not_exist():


@given(contract=contract_strategy("BrownieTester"))
@settings(suppress_health_check=[HealthCheck.function_scoped_fixture])
def test_given(tester, contract):
assert isinstance(contract, ProjectContract)

0 comments on commit f7a657b

Please sign in to comment.