1616from test_serializer import _find_version
1717
1818TESTTIMEOUT = 10.0 # seconds
19- needs_osdup = py . test .mark .skipif ("not hasattr(os, 'dup')" )
19+ needs_osdup = pytest .mark .skipif ("not hasattr(os, 'dup')" )
2020
2121
2222flakytest = pytest .mark .xfail (
@@ -36,10 +36,10 @@ def test_deprecation(recwarn, monkeypatch):
3636 execnet .PopenGateway ().exit ()
3737 assert recwarn .pop (DeprecationWarning )
3838 monkeypatch .setattr (socket , "socket" , fails )
39- py . test .raises (Exception , execnet .SocketGateway , "localhost" , 8811 )
39+ pytest .raises (Exception , execnet .SocketGateway , "localhost" , 8811 )
4040 assert recwarn .pop (DeprecationWarning )
4141 monkeypatch .setattr (subprocess , "Popen" , fails )
42- py . test .raises (Exception , execnet .SshGateway , "not-existing" )
42+ pytest .raises (Exception , execnet .SshGateway , "not-existing" )
4343 assert recwarn .pop (DeprecationWarning )
4444
4545
@@ -213,7 +213,7 @@ def test_remote_exec_waitclose_noarg(self, gw):
213213 def test_remote_exec_error_after_close (self , gw ):
214214 channel = gw .remote_exec ("pass" )
215215 channel .waitclose (TESTTIMEOUT )
216- py . test .raises (IOError , channel .send , 0 )
216+ pytest .raises (IOError , channel .send , 0 )
217217
218218 def test_remote_exec_no_explicit_close (self , gw ):
219219 channel = gw .remote_exec ("channel.close()" )
@@ -353,7 +353,7 @@ def test_receive_on_remote_sysexit(self, gw):
353353 raise SystemExit()
354354 """
355355 )
356- py . test .raises (channel .RemoteError , channel .receive )
356+ pytest .raises (channel .RemoteError , channel .receive )
357357
358358 def test_dont_write_bytecode (self , makegateway ):
359359 check_sys_dont_write_bytecode = """
@@ -371,9 +371,9 @@ def test_dont_write_bytecode(self, makegateway):
371371 assert ret
372372
373373
374- @py . test .mark .skipif ("config.option.broken_isp" )
374+ @pytest .mark .skipif ("config.option.broken_isp" )
375375def test_socket_gw_host_not_found (gw , makegateway ):
376- py . test .raises (execnet .HostNotFound , lambda : makegateway ("socket=qwepoipqwe:9000" ))
376+ pytest .raises (execnet .HostNotFound , lambda : makegateway ("socket=qwepoipqwe:9000" ))
377377
378378
379379class TestSshPopenGateway :
@@ -384,7 +384,7 @@ def test_sshconfig_config_parsing(self, monkeypatch, makegateway):
384384 monkeypatch .setattr (
385385 gateway_io , "Popen2IOMaster" , lambda * args , ** kwargs : l .append (args [0 ])
386386 )
387- py . test .raises (AttributeError , lambda : makegateway ("ssh=xyz//ssh_config=qwe" ))
387+ pytest .raises (AttributeError , lambda : makegateway ("ssh=xyz//ssh_config=qwe" ))
388388
389389 assert len (l ) == 1
390390 popen_args = l [0 ]
@@ -395,7 +395,7 @@ def test_sshaddress(self, gw, specssh):
395395 assert gw .remoteaddress == specssh .ssh
396396
397397 def test_host_not_found (self , gw , makegateway ):
398- py . test .raises (
398+ pytest .raises (
399399 execnet .HostNotFound , lambda : makegateway ("ssh=nowhere.codespeak.net" )
400400 )
401401
@@ -477,7 +477,7 @@ def test_popen_filetracing(self, testdir, monkeypatch, makegateway):
477477 if worker_line in line :
478478 break
479479 else :
480- py . test .fail ("did not find {!r} in tracefile" .format (worker_line ))
480+ pytest .fail ("did not find {!r} in tracefile" .format (worker_line ))
481481 gw .exit ()
482482
483483 @skip_win_pypy
@@ -498,7 +498,7 @@ def test_no_tracing_by_default(self):
498498
499499
500500class TestStringCoerce :
501- @py . test .mark .skipif ('sys.version>="3.0"' )
501+ @pytest .mark .skipif ('sys.version>="3.0"' )
502502 def test_2to3 (self , makegateway ):
503503 python = _find_version ("3" )
504504 gw = makegateway ("popen//python=%s" % python )
@@ -515,7 +515,7 @@ def test_2to3(self, makegateway):
515515 assert isinstance (res , str )
516516 gw .exit ()
517517
518- @py . test .mark .skipif ('sys.version<"3.0"' )
518+ @pytest .mark .skipif ('sys.version<"3.0"' )
519519 def test_3to2 (self , makegateway ):
520520 python = _find_version ("2" )
521521 gw = makegateway ("popen//python=%s" % python )
0 commit comments