Skip to content

Commit 0a05ebe

Browse files
committed
test: add test for building wheel
1 parent f239feb commit 0a05ebe

File tree

2 files changed

+32
-0
lines changed

2 files changed

+32
-0
lines changed

test/requirements.txt

+1
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,5 @@ idna>=2.5,<3; python_version < "3"
55
idna>=2.5,<4; python_version >= "3"
66
urllib3>=1.21.1,<1.27
77
certifi>=2017.4.17
8+
wheel
89
# =====

test/test_wheel.py

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
#!/usr/bin/env python
2+
#
3+
# Copyright 2015 Falldog Hsieh <[email protected]>
4+
#
5+
# Licensed under the Apache License, Version 2.0 (the "License");
6+
# you may not use this file except in compliance with the License.
7+
# You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing, software
12+
# distributed under the License is distributed on an "AS IS" BASIS,
13+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
# See the License for the specific language governing permissions and
15+
# limitations under the License.
16+
17+
import os
18+
import subprocess
19+
from test import base
20+
21+
from src.config import PASSPHRASE_ENV
22+
23+
24+
class TestWheel(base.TestPyConcreteBase):
25+
def test_building_by_wheel(self):
26+
env = os.environ.copy()
27+
env[PASSPHRASE_ENV] = 'test'
28+
sp = subprocess.run('pip wheel .', env=env, shell=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
29+
if sp.returncode != 0:
30+
print(sp.stdout.decode('utf-8'))
31+
raise Exception("pip create wheel fail...")

0 commit comments

Comments
 (0)