# Path: yaspin/constants.py
# ENCODING = "utf-8"


import os
import sys
import uuid
import pytest
from yaspin.constants import ENCODING
"""
tests.test_pipes
~~~~~~~~~~~~~~~~

Checks that scripts with yaspin are safe
for pipes and redirects:

  $ python script_that_uses_yaspin.py > script.log
  $ python script_that_uses_yaspin.py | grep ERROR

"""





TEST_CODE = """\
import time
from yaspin import yaspin, Spinner

with yaspin(Spinner(%s, %s), '%s') as sp:
    time.sleep(0.5)
    sp.fail('🙀')
"""



# Path: yaspin/constants.py
# ENCODING = "utf-8"


# Path: tests/test_pipes.py
import os
import sys
import uuid
import pytest
from yaspin.constants import ENCODING

"""
tests.test_pipes
~~~~~~~~~~~~~~~~

Checks that scripts with yaspin are safe
for pipes and redirects:

  $ python script_that_uses_yaspin.py > script.log
  $ python script_that_uses_yaspin.py | grep ERROR

"""





TEST_CODE = """\
import time
from yaspin import yaspin, Spinner

with yaspin(Spinner(%s, %s), '%s') as sp:
    time.sleep(0.5)
    sp.fail('🙀')
"""



def to_bytes(str_or_bytes, encoding=ENCODING):