Skip to content

Commit

Permalink
test: show we can have sets of projects (#2235)
Browse files Browse the repository at this point in the history
  • Loading branch information
antazoey authored Aug 22, 2024
1 parent ee4e5fd commit 33b2fb5
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 1 deletion.
9 changes: 8 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,14 @@ include = '\.pyi?$'

[tool.pytest.ini_options]
norecursedirs = "projects"
addopts = "-p no:ape_test" # NOTE: Prevents the ape plugin from activating on our tests

# NOTE: 'no:ape_test' Prevents the ape plugin from activating on our tests
# And 'pytest_ethereum' is not used and causes issues in some environments.
addopts = """
-p no:ape_test
-p no:pytest_ethereum
"""

python_files = "test_*.py"
testpaths = "tests"
markers = """fuzzing: Run Hypothesis fuzz test suite
Expand Down
16 changes: 16 additions & 0 deletions tests/functional/test_project.py
Original file line number Diff line number Diff line change
Expand Up @@ -627,6 +627,22 @@ def test_from_python_library(self):
assert "site-packages" in str(web3.path)
assert web3.path.name == "web3"

def test_hash(self, with_dependencies_project_path, project_from_manifest):
"""
Show we can use projects in sets.
"""
project_0 = Project(with_dependencies_project_path)
project_1 = Project.from_python_library("web3")
project_2 = project_from_manifest

# Show we can use in sets.
project_set = {project_0, project_1, project_2}
assert len(project_set) == 3

# Show we can use as dict-keys:
project_dict = {project_0: 123}
assert project_dict[project_0] == 123


class TestBrownieProject:
"""
Expand Down

0 comments on commit 33b2fb5

Please sign in to comment.