Skip to content

Commit bebe2e9

Browse files
committed
Use pytest + minor improvements
1 parent 3e55744 commit bebe2e9

File tree

7 files changed

+75
-46
lines changed

7 files changed

+75
-46
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
fail-fast: false
1919
matrix:
2020
os: ["ubuntu-latest", "windows-2022"]
21-
type: ["brownie", "buidler", "dapp", "embark", "etherlime", "hardhat", "solc", "truffle", "waffle", "foundry", "metadata"]
21+
type: ["brownie", "buidler", "dapp", "embark", "etherlime", "hardhat", "solc", "truffle", "waffle", "foundry"]
2222
exclude:
2323
# Currently broken, tries to pull git:// which is blocked by GH
2424
- type: embark

.github/workflows/pytest.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: Pytest
2+
3+
defaults:
4+
run:
5+
# To load bashrc
6+
shell: bash -ieo pipefail {0}
7+
8+
on:
9+
push:
10+
branches:
11+
- main
12+
- dev
13+
pull_request:
14+
branches: [main, dev]
15+
schedule:
16+
# run CI every day even if no PRs/merges occur
17+
- cron: '0 12 * * *'
18+
19+
jobs:
20+
tests:
21+
runs-on: ubuntu-latest
22+
23+
steps:
24+
- uses: actions/checkout@v1
25+
- name: Set up Python 3.8
26+
uses: actions/setup-python@v1
27+
with:
28+
python-version: 3.8
29+
30+
# Used by ci_test.sh
31+
- name: Install dependencies
32+
run: |
33+
python setup.py install
34+
pip install pytest
35+
- name: Run Tests
36+
run: |
37+
pytest tests/test_metadata.py

crytic_compile/source_unit.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -559,7 +559,7 @@ def metadata_of(self, name: str) -> Dict[str, Union[str, bool]]:
559559
# the metadata is at the end of the runtime(!) bytecode
560560
try:
561561
bytecode = self._runtime_bytecodes[name]
562-
print('runtime bytecode', bytecode)
562+
print("runtime bytecode", bytecode)
563563
except:
564564
raise ValueError( # pylint: disable=raise-missing-from
565565
f"contract {name} does not exist"

scripts/ci_test_metadata.sh

Lines changed: 0 additions & 30 deletions
This file was deleted.

tests/expected/metadata.json

Lines changed: 0 additions & 1 deletion
This file was deleted.

tests/metadata_test.py

Lines changed: 0 additions & 13 deletions
This file was deleted.

tests/test_metadata.py

Lines changed: 36 additions & 0 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)