Skip to content

Commit bd69862

Browse files
authored
test input: use explicit package declaration (#345)
1 parent 74205e3 commit bd69862

File tree

78 files changed

+141
-37
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

78 files changed

+141
-37
lines changed

.github/workflows/ci.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ jobs:
1313
name: ${{ matrix.os }} / ${{ matrix.python-version }}
1414
runs-on: ${{ matrix.os }}-latest
1515
strategy:
16+
fail-fast: false
1617
matrix:
1718
os: [Ubuntu, MacOS, Windows]
1819
python-version: ['3.6.7', '3.7', '3.8', '3.9', '3.10']
@@ -56,9 +57,7 @@ jobs:
5657

5758
- name: Install dependencies
5859
shell: bash
59-
run: |
60-
poetry run python -m pip install pip -U
61-
poetry install
60+
run: poetry install
6261

6362
- name: Generate code from proto files
6463
shell: bash

tests/conftest.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
import copy
2+
import sys
3+
14
import pytest
25

36

@@ -10,3 +13,10 @@ def pytest_addoption(parser):
1013
@pytest.fixture(scope="session")
1114
def repeat(request):
1215
return request.config.getoption("repeat")
16+
17+
18+
@pytest.fixture
19+
def reset_sys_path():
20+
original = copy.deepcopy(sys.path)
21+
yield
22+
sys.path = original

tests/generate.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ async def generate_test_case_output(
7878
"""
7979

8080
test_case_output_path_reference = output_path_reference.joinpath(test_case_name)
81-
test_case_output_path_betterproto = output_path_betterproto.joinpath(test_case_name)
81+
test_case_output_path_betterproto = output_path_betterproto
8282

8383
os.makedirs(test_case_output_path_reference, exist_ok=True)
8484
os.makedirs(test_case_output_path_betterproto, exist_ok=True)

tests/grpc/test_grpclib_client.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,12 @@
77
import pytest
88
from betterproto.grpc.util.async_channel import AsyncChannel
99
from grpclib.testing import ChannelFor
10-
from tests.output_betterproto.service.service import (
10+
from tests.output_betterproto.service import (
1111
DoThingRequest,
1212
DoThingResponse,
1313
GetThingRequest,
1414
)
15-
from tests.output_betterproto.service.service import TestStub as ThingServiceClient
15+
from tests.output_betterproto.service import TestStub as ThingServiceClient
1616

1717
from .thing_service import ThingService
1818

tests/grpc/thing_service.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from tests.output_betterproto.service.service import (
1+
from tests.output_betterproto.service import (
22
DoThingResponse,
33
DoThingRequest,
44
GetThingRequest,

tests/inputs/bool/bool.proto

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
syntax = "proto3";
22

3+
package bool;
4+
35
message Test {
46
bool value = 1;
57
}

tests/inputs/bytes/bytes.proto

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
syntax = "proto3";
22

3+
package bytes;
4+
35
message Test {
46
bytes data = 1;
57
}

tests/inputs/casing/casing.proto

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
syntax = "proto3";
22

3+
package casing;
4+
35
enum my_enum {
46
ZERO = 0;
57
ONE = 1;

tests/inputs/casing_message_field_uppercase/casing_message_field_uppercase.proto

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
syntax = "proto3";
22

3+
package casing_message_field_uppercase;
4+
35
message Test {
46
int32 UPPERCASE = 1;
57
int32 UPPERCASE_V2 = 2;

tests/inputs/deprecated/deprecated.proto

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
syntax = "proto3";
22

3+
package deprecated;
4+
35
// Some documentation about the Test message.
46
message Test {
57
// Some documentation about the value.

0 commit comments

Comments
 (0)