From fab7721508b2d74fcdc60c83288f50a89e6db283 Mon Sep 17 00:00:00 2001 From: iamdefinitelyahuman Date: Tue, 21 Jan 2020 22:13:33 +0400 Subject: [PATCH] bugfix: preserve pytest rootdir when project is inside another python project --- brownie/test/managers/base.py | 6 ++++++ requirements.txt | 1 + setup.cfg | 2 +- 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/brownie/test/managers/base.py b/brownie/test/managers/base.py index d4b71d04e..2c482df6a 100644 --- a/brownie/test/managers/base.py +++ b/brownie/test/managers/base.py @@ -3,6 +3,8 @@ import json from hashlib import sha1 +from py.path import local + from brownie._config import ARGV, CONFIG from brownie.project.scripts import _get_ast_hash from brownie.test import coverage, output @@ -14,8 +16,12 @@ class PytestBrownieBase: def __init__(self, config, project): self.config = config + # required when brownie project is in a subfolder of another project + config.rootdir = local(project._path) + self.project = project self.project_path = project._path + self.results = {} self.node_map = {} self.isolated = {} diff --git a/requirements.txt b/requirements.txt index c312c69d5..1be74d29e 100644 --- a/requirements.txt +++ b/requirements.txt @@ -6,6 +6,7 @@ eth-hash[pycryptodome]==0.2.0 eth-utils==1.8.0 hexbytes==0.2.0 psutil>=5.6.2,<6.0.0 +py>=1.5.0 pyreadline==2.1;platform_system=='Windows' py-solc-ast>=1.1.0,<2.0.0 py-solc-x>=0.7.1,<1.0.0 diff --git a/setup.cfg b/setup.cfg index c0be2aae6..a36923d4d 100644 --- a/setup.cfg +++ b/setup.cfg @@ -16,7 +16,7 @@ ignore = E203,W503 force_grid_wrap = 0 include_trailing_comma = True known_first_party = brownie -known_third_party = _pytest,docopt,ens,eth_abi,eth_event,eth_hash,eth_keys,eth_utils,ethpm,hexbytes,mythx_models,psutil,pytest,pythx,requests,semantic_version,setuptools,solcast,solcx,tqdm,vyper,web3,xdist,yaml +known_third_party = _pytest,docopt,ens,eth_abi,eth_event,eth_hash,eth_keys,eth_utils,ethpm,hexbytes,mythx_models,psutil,py,pytest,pythx,requests,semantic_version,setuptools,solcast,solcx,tqdm,vyper,web3,xdist,yaml line_length = 100 multi_line_output = 3 use_parentheses = True