HEX
Server: Apache
System: Linux beluga.o2switch.net 4.18.0-553.123.2.lve.el8.x86_64 #1 SMP Thu May 7 23:17:13 UTC 2026 x86_64
User: sc3naki1272 (1113)
PHP: 8.3.33
Disabled: NONE
Upload Files
File: //opt/alt/python37/lib/python3.7/site-packages/testfixtures/tests/test_generator.py
# Copyright (c) 2008 Simplistix Ltd
# See license.txt for license details.

from unittest import TestCase, TestSuite, makeSuite

from testfixtures import generator
from types import GeneratorType


class TestG(TestCase):

    def test_example(self):
        g = generator(1, 2, 3)
        self.failUnless(isinstance(g, GeneratorType))
        self.assertEqual(tuple(g), (1, 2, 3))

    def test_from_sequence(self):
        s = (1, 2, 3)
        g = generator(*s)
        self.failUnless(isinstance(g, GeneratorType))
        self.assertEqual(tuple(g), (1, 2, 3))