11""" Test the actual run
22"""
33import os
4- import py
4+ import pytest
55import sys
66import tempfile
77import time
1010import pytz
1111import vmprof
1212import six
13- import pytest
1413from cffi import FFI
1514from datetime import datetime
1615import requests
@@ -203,7 +202,7 @@ def test_nested_call():
203202
204203def 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
243242def 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'" )
262261def 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'" )
328327def 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'" )
466465class 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 ):
0 commit comments