-3

Have one pytest parameter having single quote in the string value. For example,

@pytest.mark.parametrize(
    'message1, code, message2', [
    ('test_exception_message', 'error_code_example', ''apples' are in the 'basket'')])

message2 = 'apples' are in the 'basket'

How to handle the quotes? Thanks.

susanna
  • 1,395
  • 3
  • 20
  • 32

1 Answers1

1
message2 = "'apples' are in the 'basket'"

use double quotes or escape using

'\'apples\' are in the \'basket\''
hedy
  • 1,160
  • 5
  • 23