Skip to content

Commit cd416a4

Browse files
authored
Merge pull request #36 from pipermerriam/piper/actually-test-against-0.4.17
test against 0.4.17 too
2 parents 5ec1865 + 4622cc6 commit cd416a4

File tree

2 files changed

+39
-15
lines changed

2 files changed

+39
-15
lines changed

.travis.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,13 @@ matrix:
105105
env: TOX_POSARGS="-e py34-stdlib -e py34-gevent" SOLC_VERSION=v0.4.16
106106
- python: "3.5"
107107
env: TOX_POSARGS="-e py35-stdlib -e py35-gevent" SOLC_VERSION=v0.4.16
108+
# solc 0.4.17
109+
- python: "2.7"
110+
env: TOX_POSARGS="-e py27-stdlib -e py27-gevent" SOLC_VERSION=v0.4.17
111+
- python: "3.4"
112+
env: TOX_POSARGS="-e py34-stdlib -e py34-gevent" SOLC_VERSION=v0.4.17
113+
- python: "3.5"
114+
env: TOX_POSARGS="-e py35-stdlib -e py35-gevent" SOLC_VERSION=v0.4.17
108115
cache:
109116
- pip: true
110117
before_install:

tests/conftest.py

Lines changed: 32 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,14 @@ def contracts_dir(tmpdir):
1313
return str(tmpdir.mkdir("contracts"))
1414

1515

16+
@pytest.fixture(scope="session")
17+
def solc_version():
18+
return get_solc_version()
19+
20+
1621
@pytest.fixture()
17-
def supported_solc_version():
18-
solc_version = get_solc_version()
19-
if solc_version not in Spec('>=0.4.1,<=0.4.16,!=0.4.10,!=0.4.3,!=0.4.4,!=0.4.5'):
22+
def supported_solc_version(solc_version):
23+
if solc_version not in Spec('>=0.4.1,<=0.4.17,!=0.4.10,!=0.4.3,!=0.4.4,!=0.4.5'):
2024
raise AssertionError("Unsupported compiler version: {0}".format(solc_version))
2125

2226
return solc_version
@@ -28,18 +32,31 @@ def is_new_key_format():
2832

2933

3034
@pytest.fixture()
31-
def FOO_SOURCE(supported_solc_version):
32-
return textwrap.dedent('''\
33-
pragma solidity ^0.4.0;
35+
def FOO_SOURCE(supported_solc_version, solc_version):
36+
if solc_version in Spec('<0.4.17'):
37+
return textwrap.dedent('''\
38+
pragma solidity ^0.4.0;
3439
35-
contract Foo {
36-
function Foo() {}
40+
contract Foo {
41+
function Foo() {}
3742
38-
function return13() returns (uint) {
39-
return 13;
43+
function return13() public returns (uint) {
44+
return 13;
45+
}
4046
}
41-
}
42-
''')
47+
''')
48+
else:
49+
return textwrap.dedent('''\
50+
pragma solidity ^0.4.17;
51+
52+
contract Foo {
53+
function Foo() public {}
54+
55+
function return13() public pure returns (uint) {
56+
return 13;
57+
}
58+
}
59+
''')
4360

4461

4562
@pytest.fixture()
@@ -48,7 +65,7 @@ def BAR_SOURCE(supported_solc_version):
4865
pragma solidity ^0.4.0;
4966
5067
contract Bar {
51-
function Bar() {}
68+
function Bar() public {}
5269
}
5370
''')
5471

@@ -61,9 +78,9 @@ def BAZ_SOURCE(supported_solc_version):
6178
import "contracts/Bar.sol";
6279
6380
contract Baz is Bar {
64-
function Baz() {}
81+
function Baz() public {}
6582
66-
function get_funky() returns (string) {
83+
function get_funky() public returns (string) {
6784
return "funky";
6885
}
6986
}

0 commit comments

Comments
 (0)