3232SOME_API_KEY = "ABC123"
3333
3434test_config = """\
35- [main]
36- shots = 1000
37-
3835 [default.gaussian]
3936hbar = 2
4037
4138[aqt.sim]
42- shots = 99
4339api_key = "{}"
4440""" .format (
4541 SOME_API_KEY
@@ -467,12 +463,9 @@ def test_device_gets_local_config(self, monkeypatch, tmpdir):
467463 "pennylane.default_config" , qml .Configuration ("config.toml" )
468464 ) # force loading of config
469465
470- with pytest .warns (
471- qml .exceptions .PennyLaneDeprecationWarning , match = "shots on device is deprecated"
472- ):
473- dev = qml .device ("aqt.sim" , wires = 2 )
466+ dev = qml .device ("aqt.sim" , wires = 2 )
474467
475- assert dev .shots .total_shots == 99
468+ assert dev .shots .total_shots is None # note that dev.shots is deprecated
476469 assert API_HEADER_KEY in dev .header .keys ()
477470 assert dev .header [API_HEADER_KEY ] == SOME_API_KEY
478471
@@ -493,10 +486,7 @@ def test_device_gets_api_key_default_config_directory(self, monkeypatch, tmpdir)
493486 c = qml .Configuration ("config.toml" )
494487 monkeypatch .setattr ("pennylane.default_config" , c ) # force loading of config
495488
496- with pytest .warns (
497- qml .exceptions .PennyLaneDeprecationWarning , match = "shots on device is deprecated"
498- ):
499- dev = qml .device ("aqt.sim" , wires = 2 )
489+ dev = qml .device ("aqt.sim" , wires = 2 )
500490
501491 assert API_HEADER_KEY in dev .header .keys ()
502492 assert dev .header [API_HEADER_KEY ] == SOME_API_KEY
@@ -515,10 +505,7 @@ def test_device_gets_api_key_pennylane_conf_env_var(self, monkeypatch, tmpdir):
515505 "pennylane.default_config" , qml .Configuration ("config.toml" )
516506 ) # force loading of config
517507
518- with pytest .warns (
519- qml .exceptions .PennyLaneDeprecationWarning , match = "shots on device is deprecated"
520- ):
521- dev = qml .device ("aqt.sim" , wires = 2 )
508+ dev = qml .device ("aqt.sim" , wires = 2 )
522509
523510 assert API_HEADER_KEY in dev .header .keys ()
524511 assert dev .header [API_HEADER_KEY ] == SOME_API_KEY
0 commit comments