Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def test_print_categories_prints_correct_categories(self):
with patch('sys.stdout', new=StringIO()) as output:
categories = ['Boys', 'Girls']
colors = [91, 94]
tg.print_categories(categories, colors)
output = output.getvalue().strip()
assert output == "\x1b[91m▇ Boys \x1b[0m\x1b[94m▇ Girls \x1b[0m"