Exemplo n.º 1
0
def main():
    import sys
    if len(sys.argv) > 1:
        exec(sys.argv[1])
    else:
        if not SKIP_TESTS:
            # Run tests.
            from py.test import main
            result = main([__file__])
            assert result == 0

        # Run examples.
        problem_stats()
        statement_counts_table()
        scalar_assignment_percent_of_total_mem_ops_table()
        scalar_assignment_effect_of_fusion_mem_ops_table()
# -*- coding: utf-8 -*-
import re
import sys

from py.test import main

if __name__ == '__main__':
    sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0])
    sys.exit(main())
Exemplo n.º 3
0
        self.repr_eval_test(p)

        #assert p.std.path()

    def test_local(self):
        p = path.local()
        assert hasattr(p, 'atime')
        assert hasattr(p, 'setmtime')
        assert p.check()
        assert p.check(local=1)
        self.repr_eval_test(p)

    def test_svnurl(self):
        p = path.svnurl('http://codespeak.net/svn/py')
        assert p.check(svnurl=1)
        self.repr_eval_test(p)

    def test_svnwc(self):
        p = path.svnwc(self.root)
        assert p.check(svnwc=1)
        self.repr_eval_test(p)

    #def test_fspy(self):
    #    p = path.py('smtplib.SMTP')
    #    self.repr_eval_test(p)


if __name__ == '__main__':
    test.main()

Exemplo n.º 4
0
def test():
    """ Runs BEM++ python unit tests """
    from py.test import main
    from os.path import dirname
    main(dirname(__file__))
Exemplo n.º 5
0
def test():
    from py.test import main
    from os.path import dirname
    main(dirname(__file__))
Exemplo n.º 6
0
            )),
              file=outf)
    logger.info("Wrote '%s'", outf.name)


# }}}


def main():
    import sys
    if len(sys.argv) > 1:
        exec(sys.argv[1])
    else:
        if not SKIP_TESTS:
            # Run tests.
            from py.test import main
            result = main([__file__])
            assert result == 0

        # Run examples.
        problem_stats()
        statement_counts_table()
        scalar_assignment_percent_of_total_mem_ops_table()
        scalar_assignment_effect_of_fusion_mem_ops_table()


if __name__ == "__main__":
    main()

# vim: foldmethod=marker
Exemplo n.º 7
0
        md.Point(1.0, 0.0)
    ]

    for th, an in zip(ths, ans):
        assert np.allclose(pt0.rotate(th).asArray, an.asArray)


def test_Rotate_Point_about_self():
    """
	Rotating a point about itself yields the same Point
	Also tests multiple angles to rotate about
	"""

    a = [0, -1, 1]
    pts = [md.Point(x, y) for x, y in zip(a, a)]

    for pt in pts:
        for th in np.arange(0, 2 * np.pi, 15):
            assert np.allclose(pt.asArray, pt.rotate(th, about=pt).asArray)


def test_Point_Rotation_about_Point():
    pt1 = md.Point(1.0, 0.0).rotate(np.pi / 2, about=md.Point(0, 0))
    pt2 = md.Point(0.0, 1.0)

    assert np.allclose(pt1.asArray, pt2.asArray)


if __name__ == '__main__':
    main([__file__])
if __name__ == '__main__':
    import sys
    from py.test import main

    sys.exit(main())
Exemplo n.º 9
0
def test():
    """ Runs BEM++ python unit tests """
    from py.test import main
    from os.path import dirname
    main(dirname(__file__))
Exemplo n.º 10
0
        self.repr_eval_test(p)

        #assert p.std.path()

    def test_local(self):
        p = path.local()
        assert hasattr(p, 'atime')
        assert hasattr(p, 'setmtime')
        assert p.check()
        assert p.check(local=1)
        self.repr_eval_test(p)

    def test_svnurl(self):
        p = path.svnurl('http://codespeak.net/svn/py')
        assert p.check(svnurl=1)
        self.repr_eval_test(p)

    def test_svnwc(self):
        p = path.svnwc(self.root)
        assert p.check(svnwc=1)
        self.repr_eval_test(p)

    #def test_fspy(self):
    #    p = path.py('smtplib.SMTP')
    #    self.repr_eval_test(p)


if __name__ == '__main__':
    test.main()

Exemplo n.º 11
0
def test():
    from py.test import main
    from os.path import dirname
    main(dirname(__file__))