@@ -155,7 +155,7 @@ const PyInt = pyversion < v"3" ? Int : Clonglong
155155
156156 # issue #92:
157157 let x = PyVector (PyAny[])
158- py " lambda x: x.append(\ " bar\" ) " (x)
158+ py ` lambda x: x.append("bar") ` (x)
159159 @test x == [" bar" ]
160160 end
161161
@@ -267,21 +267,21 @@ const PyInt = pyversion < v"3" ? Int : Clonglong
267267 @test convert (BigInt, PyObject (1234 )) == 1234
268268
269269 # hasproperty, getproperty, and propertynames
270- py """
270+ py ```
271271 class A:
272272 class B:
273273 C = 1
274- """
275- A = py " A "
274+ ```
275+ A = py ` A `
276276 @test hasproperty (A, " B" )
277- @test getproperty (A, " B" ) == py " A.B"
277+ @test getproperty (A, " B" ) == py ` A.B`
278278 @test :B in propertynames (A)
279279 @static if VERSION >= v " 0.7-"
280280 @test A. B. C == 1
281281 @test_throws KeyError A. X
282282 end
283- setproperty! (py " A.B" , " C" , 2 )
284- @test py " A.B.C" == 2
283+ setproperty! (py ` A.B` , " C" , 2 )
284+ @test py ` A.B.C` == 2
285285
286286 # buffers
287287 let b = PyCall. PyBuffer (pyutf8 (" test string" ))
@@ -373,23 +373,23 @@ const PyInt = pyversion < v"3" ? Int : Clonglong
373373 end
374374
375375 let x = 7
376- py """
376+ py ```
377377 def myfun(x):
378378 return x + $x
379- """
380- @test py " 1 + 2" == 3
381- @test py " 1 + $x" == 8
382- @test py " 1 + $(x^2)" == 50
383- @test py " myfun" (10 ) == 17
379+ ```
380+ @test py ` 1 + 2` == 3
381+ @test py ` 1 + $x ` == 8
382+ @test py ` 1 + $(x^ 2 ) ` == 50
383+ @test py ` myfun` (10 ) == 17
384384 end
385385
386386 # issue #352
387387 let x = " 1+1"
388- @test py " $x " == " 1+1"
389- @test py " $$x" == py " $$(x)" == 2
390- @test py " 7 - $$x - 7" == 0 # evaluates "7 - 1 + 1 - 7"
391- @test py " 7 - ($$x) - 7" == - 2 # evaluates "7 - (1 + 1) - 7"
392- @test py " 1 + $$(x[1:2]) 3" == 5 # evals 1 + 1+ 3
388+ @test py ` $x ` == " 1+1"
389+ @test py ` $$x ` == py ` $$(x) ` == 2
390+ @test py ` 7 - $$x - 7` == 0 # evaluates "7 - 1 + 1 - 7"
391+ @test py ` 7 - ($$x ) - 7` == - 2 # evaluates "7 - (1 + 1) - 7"
392+ @test py ` 1 + $$(x[1 : 2 ]) 3` == 5 # evals 1 + 1+ 3
393393 end
394394
395395 # Float16 support:
@@ -429,15 +429,15 @@ const PyInt = pyversion < v"3" ? Int : Clonglong
429429 end
430430
431431 # Expose python docs to Julia doc system
432- py """
432+ py ```
433433 def foo():
434434 "foo docstring"
435435 return 0
436436 class bar:
437437 foo = foo
438- """
439- global foo354 = py " foo"
440- global barclass = py " bar"
438+ ```
439+ global foo354 = py ` foo`
440+ global barclass = py ` bar`
441441 # use 'content' since `Text` objects test equality by object identity
442442 @test @doc (foo354). content == " foo docstring"
443443 @test @doc (barclass. foo). content == " foo docstring"
@@ -518,7 +518,7 @@ const PyInt = pyversion < v"3" ? Int : Clonglong
518518 end
519519
520520 @test occursin (" integer" , Base. Docs. doc (PyObject (1 )). content)
521- @test occursin (" no docstring" , Base. Docs. doc (PyObject (py " lambda x: x+1" )). content)
521+ @test occursin (" no docstring" , Base. Docs. doc (PyObject (py ` lambda x: x+1` )). content)
522522
523523 let b = rand (UInt8, 1000 )
524524 @test (convert (Vector{UInt8}, pybytes (b)) == b
@@ -555,9 +555,9 @@ const PyInt = pyversion < v"3" ? Int : Clonglong
555555 @test_throws KeyError PyObject (TestConstruct (1 )). y
556556
557557 # iterating over Julia objects in Python:
558- @test py " [x**2 for x in $(PyCall.pyjlwrap_new(1:4))]" ==
559- py " [x**2 for x in $(x for x in 1:4)]" ==
560- py " [x**2 for x in $(PyCall.jlwrap_iterator(1:4))]" ==
558+ @test py ` [x**2 for x in $(PyCall. pyjlwrap_new (1 : 4 )) ]` ==
559+ py ` [x**2 for x in $(x for x in 1 : 4 ) ]` ==
560+ py ` [x**2 for x in $(PyCall. jlwrap_iterator (1 : 4 )) ]` ==
561561 [1 ,4 ,9 ,16 ]
562562
563563 let o = PyObject (" foo" )
@@ -580,7 +580,7 @@ const PyInt = pyversion < v"3" ? Int : Clonglong
580580 end
581581
582582 # issue #533
583- @test py " lambda x,y,z: (x,y,z)" (3 : 6 ,4 : 10 ,5 : 11 ) === (PyInt (3 ): PyInt (6 ), PyInt (4 ): PyInt (10 ), PyInt (5 ): PyInt (11 ))
583+ @test py ` lambda x,y,z: (x,y,z)` (3 : 6 ,4 : 10 ,5 : 11 ) === (PyInt (3 ): PyInt (6 ), PyInt (4 ): PyInt (10 ), PyInt (5 ): PyInt (11 ))
584584
585585 @test float (PyObject (1 )) === 1.0
586586 @test float (PyObject (1 + 2im )) === 1.0 + 2.0im
@@ -650,12 +650,12 @@ end
650650 using PyCall
651651 obj = pyimport (" sys" ) # get some PyObject
652652 end )
653- py """
653+ py ```
654654 ns = {}
655655 def set(name):
656656 ns[name] = $include_string ($anonymous , name)
657- """
658- py " set" (" obj" )
657+ ```
658+ py ` set` (" obj" )
659659 @test anonymous. obj != PyNULL ()
660660
661661 # Test above for pyjlwrap_getattr too:
@@ -668,12 +668,12 @@ end
668668 end
669669 obj = S (pyimport (" sys" ))
670670 end )
671- py """
671+ py ```
672672 ns = {}
673673 def set(name):
674674 ns[name] = $include_string ($anonymous , name).x
675- """
676- py " set" (" obj" )
675+ ```
676+ py ` set` (" obj" )
677677 @test anonymous. obj. x != PyNULL ()
678678
679679 # Test above for pyjlwrap_iternext too:
@@ -684,41 +684,41 @@ end
684684 sys = pyimport (" sys" )
685685 obj = (sys for _ in 1 : 1 )
686686 end )
687- py """
687+ py ```
688688 ns = {}
689689 def set(name):
690690 ns[name] = list(iter($include_string ($anonymous , name)))
691- """
692- py " set" (" obj" )
691+ ```
692+ py ` set` (" obj" )
693693 @test anonymous. sys != PyNULL ()
694694end
695695
696696struct Unprintable end
697697Base. show (:: IO , :: Unprintable ) = error (" show(::IO, ::Unprintable) called" )
698698Base. show (:: IO , :: Type{Unprintable} ) = error (" show(::IO, ::Type{Unprintable}) called" )
699699
700- py """
700+ py ```
701701def try_repr(x):
702702 try:
703703 return repr(x)
704704 except Exception as err:
705705 return err
706- """
706+ ```
707707
708- py """
708+ py ```
709709def try_call(f):
710710 try:
711711 return f()
712712 except Exception as err:
713713 return err
714- """
714+ ```
715715
716716@testset " throwing show" begin
717717 unp = Unprintable ()
718718 @test_throws Exception show (unp)
719- @test py " try_repr" (" printable" ) isa String
720- @test pyisinstance (py " try_repr" (unp), pybuiltin (" Exception" ))
721- @test pyisinstance (py " try_call" (() -> throw (Unprintable ())),
719+ @test py ` try_repr` (" printable" ) isa String
720+ @test pyisinstance (py ` try_repr` (unp), pybuiltin (" Exception" ))
721+ @test pyisinstance (py ` try_call` (() -> throw (Unprintable ())),
722722 pybuiltin (" Exception" ))
723723end
724724
@@ -749,25 +749,25 @@ end
749749 @test Base. IteratorSize (PyCall. PyIterator (PyObject ([1 ]))) == Base. HasLength ()
750750
751751 # 594
752- @test collect (zip (py " iter([1, 2, 3])" , 1 : 3 )) ==
752+ @test collect (zip (py ` iter([1, 2, 3])` , 1 : 3 )) ==
753753 [(1 , 1 ), (2 , 2 ), (3 , 3 )]
754- @test collect (zip (PyCall. PyIterator {Int} (py " iter([1, 2, 3])" ), 1 : 3 )) ==
754+ @test collect (zip (PyCall. PyIterator {Int} (py ` iter([1, 2, 3])` ), 1 : 3 )) ==
755755 [(1 , 1 ), (2 , 2 ), (3 , 3 )]
756- @test collect (zip (PyCall. PyIterator (py " [1, 2, 3]" o ), 1 : 3 )) ==
756+ @test collect (zip (PyCall. PyIterator (py ` [1, 2, 3]` o ), 1 : 3 )) ==
757757 [(1 , 1 ), (2 , 2 ), (3 , 3 )]
758758end
759759
760- @test_throws PyCall. PyError py " __testing_pynamespace"
760+ @test_throws PyCall. PyError py ` __testing_pynamespace`
761761
762762module __isolated_namespace
763763using PyCall
764- py """
764+ py ```
765765__testing_pynamespace = True
766- """
767- get_testing_pynamespace () = py " __testing_pynamespace"
766+ ```
767+ get_testing_pynamespace () = py ` __testing_pynamespace`
768768end
769769
770- @test_throws PyCall. PyError py " __testing_pynamespace"
770+ @test_throws PyCall. PyError py ` __testing_pynamespace`
771771@test __isolated_namespace. get_testing_pynamespace ()
772772
773773@testset " atexit" begin
0 commit comments