stop using the py-lib · mattip/vmprof-python@1ec238d · GitHub
Skip to content

Commit 1ec238d

Browse files
committed
stop using the py-lib
1 parent a1a1b52 commit 1ec238d

6 files changed

Lines changed: 25 additions & 25 deletions

File tree

jitlog/test/test_encoding.py

Lines changed: 2 additions & 2 deletions

tox.ini

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,7 @@ envlist = py27, py34, py35, pypy
33

44

55
[testenv]
6-
deps=pytest
6+
deps=
7+
pytest
8+
cffi
79
commands=py.test vmprof/test/

vmprof/test/test_c_symboltable.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import py
21
import os
32
import sys
43
import pytest
@@ -66,7 +65,7 @@
6665

6766
ffi.compile(verbose=True)
6867

69-
@py.test.mark.skipif("sys.platform == 'win32'")
68+
@pytest.mark.skipif("sys.platform == 'win32'")
7069
class TestSymbolTable(object):
7170
def setup_class(cls):
7271
from vmprof.test import _test_symboltable as clib

vmprof/test/test_reader.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11

2-
import struct, py
2+
import struct, pytest
33
from vmprof import reader
44
from vmprof.reader import (FileReadError, MARKER_HEADER)
55
from vmprof.test.test_run import (read_one_marker, read_header,
@@ -41,7 +41,7 @@ def test_fileobj_wrapper():
4141
f1 = FileObj([b"123456"])
4242
fw = FileObjWrapper(f1)
4343
assert fw.read(4) == b"1234"
44-
exc = py.test.raises(BufferTooSmallError, fw.read, 4)
44+
exc = pytest.raises(BufferTooSmallError, fw.read, 4)
4545
f1.write(b"789")
4646
fw = FileObjWrapper(f1, exc.value.get_buf())
4747
assert fw.read(3) == b'123'

vmprof/test/test_run.py

Lines changed: 15 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
""" Test the actual run
22
"""
33
import os
4-
import py
4+
import pytest
55
import sys
66
import tempfile
77
import time
@@ -10,7 +10,6 @@
1010
import pytz
1111
import vmprof
1212
import six
13-
import pytest
1413
from cffi import FFI
1514
from datetime import datetime
1615
import requests
@@ -203,7 +202,7 @@ def test_nested_call():
203202

204203
def test_multithreaded():
205204
if '__pypy__' in sys.builtin_module_names:
206-
py.test.skip("not supported on pypy just yet")
205+
pytest.skip("not supported on pypy just yet")
207206
import threading
208207
finished = []
209208

@@ -242,7 +241,7 @@ def f():
242241

243242
def test_memory_measurment():
244243
if not sys.platform.startswith('linux') or '__pypy__' in sys.builtin_module_names:
245-
py.test.skip("unsupported platform")
244+
pytest.skip("unsupported platform")
246245
def function_foo():
247246
all = []
248247
for k in range(1000):
@@ -258,7 +257,7 @@ def function_bar():
258257
prof.get_stats()
259258

260259

261-
@py.test.mark.skipif("sys.platform == 'win32'")
260+
@pytest.mark.skipif("sys.platform == 'win32'")
262261
def test_vmprof_real_time():
263262
prof = vmprof.Profiler()
264263
with prof.measure(real_time=True):
@@ -269,9 +268,9 @@ def test_vmprof_real_time():
269268
assert d[foo_time_name] > 0
270269

271270

272-
@py.test.mark.skipif("'__pypy__' in sys.builtin_module_names")
273-
@py.test.mark.skipif("sys.platform == 'win32'")
274-
@py.test.mark.parametrize("insert_foo,remove_bar", [
271+
@pytest.mark.skipif("'__pypy__' in sys.builtin_module_names")
272+
@pytest.mark.skipif("sys.platform == 'win32'")
273+
@pytest.mark.parametrize("insert_foo,remove_bar", [
275274
(False, False),
276275
(False, True),
277276
( True, False),
@@ -293,9 +292,9 @@ def test_vmprof_real_time_threaded(insert_foo, remove_bar):
293292
assert remove_bar != (bar_time_name in d)
294293

295294

296-
@py.test.mark.skipif("'__pypy__' in sys.builtin_module_names")
297-
@py.test.mark.skipif("sys.platform == 'win32'")
298-
@py.test.mark.parametrize("insert_foo,remove_bar", [
295+
@pytest.mark.skipif("'__pypy__' in sys.builtin_module_names")
296+
@pytest.mark.skipif("sys.platform == 'win32'")
297+
@pytest.mark.parametrize("insert_foo,remove_bar", [
299298
(False, False),
300299
(False, True),
301300
( True, False),
@@ -323,8 +322,8 @@ def test_insert_other_real_time_thread(insert_foo, remove_bar):
323322
assert remove_bar != (bar_time_name in d)
324323

325324

326-
@py.test.mark.skipif("'__pypy__' in sys.builtin_module_names")
327-
@py.test.mark.skipif("sys.platform == 'win32'")
325+
@pytest.mark.skipif("'__pypy__' in sys.builtin_module_names")
326+
@pytest.mark.skipif("sys.platform == 'win32'")
328327
def test_vmprof_real_time_many_threads():
329328
import threading
330329
prof = vmprof.Profiler()
@@ -359,7 +358,7 @@ def test_gzip_problem():
359358
# ensure that the gzip process really tries to write
360359
# to the gzip proc that was killed
361360
function_foo()
362-
with py.test.raises(Exception) as exc_info:
361+
with pytest.raises(Exception) as exc_info:
363362
vmprof.disable()
364363
assert "Error while writing profile" in str(exc_info)
365364
tmpfile.close()
@@ -462,7 +461,7 @@ def test_vmprof_show():
462461
pp = PrettyPrinter()
463462
pp.show(tmpfile.name)
464463

465-
@py.test.mark.skipif("sys.platform == 'win32'")
464+
@pytest.mark.skipif("sys.platform == 'win32'")
466465
class TestNative(object):
467466
def setup_class(cls):
468467
ffi = FFI()
@@ -505,7 +504,7 @@ def setup_class(cls):
505504
cls.lib = clib.lib
506505
cls.ffi = clib.ffi
507506

508-
@py.test.mark.skipif("PY3K and PPC64LE")
507+
@pytest.mark.skipif("PY3K and PPC64LE")
509508
def test_gzip_call(self):
510509
p = vmprof.Profiler()
511510
with p.measure(native=True):

vmprof/test/test_stats.py

Lines changed: 2 additions & 2 deletions

0 commit comments

Comments
 (0)