~ubuntu-branches/debian/sid/meliae/sid

« back to all changes in this revision

Viewing changes to meliae/tests/test_perf_counter.py

  • Committer: Bazaar Package Importer
  • Author(s): Jelmer Vernooij
  • Date: 2010-07-20 18:26:22 UTC
  • mto: This revision was merged to the branch mainline in revision 3.
  • Revision ID: james.westby@ubuntu.com-20100720182622-b0ks0nu34mify1lj
Tags: upstream-0.2.1
ImportĀ upstreamĀ versionĀ 0.2.1

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2009 Canonical Ltd
 
1
# Copyright (C) 2009, 2010 Canonical Ltd
2
2
3
3
# This program is free software: you can redistribute it and/or modify
4
4
# it under the terms of the GNU General Public License version 3 as
86
86
        p.stdin.flush()
87
87
        p.stdout.read(3)
88
88
        cur_mem, peak_mem = perf_counter.perf_counter.get_memory(p)
89
 
        self.assertTrue(isinstance(cur_mem, long))
90
 
        self.assertTrue(isinstance(peak_mem, long))
 
89
        if cur_mem is None or peak_mem is None:
 
90
            # fail gracefully, though we may want a stronger assertion here
 
91
            return
 
92
        self.assertTrue(isinstance(cur_mem, (int, long)))
 
93
        self.assertTrue(isinstance(peak_mem, (int, long)))
91
94
        p.stdin.write('post')
92
95
        p.stdin.flush()
93
96
        p.stdout.read()